package org.dding.core.manager;

import java.io.IOException;
import java.util.List;

import org.dding.core.Lifecycle;
import org.dding.core.IPlatform.PlatformInfo;
import org.dding.core.management.DependencyInfo;
import org.dding.core.management.ModuleInfo;
import org.dding.core.management.ResourceLoaderInfo;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleLoadException;
import org.jboss.modules.ModuleLoader;

public interface IModuleManager extends Lifecycle {

	public void addServiceManager(IServiceManager service);

	public ModuleLoader getModuleLoader();

	public boolean isModuleExist(String module);

	public boolean unloadModule(final String name);

	public boolean unloadModule(final String name, final boolean delete);

	public Module findModule(final String name);

	public String getModulePath();

	public ModuleInfo getModuleDescription(final String name);

	public Module loadModule(String moduleIdentifer, boolean unzip)
			throws IOException, ModuleLoadException;

	public boolean loadModule(String moduleIdentifer) throws Throwable;

	public List<ResourceLoaderInfo> getResourceLoaders(
			final String moduleIdentifer);

	public List<DependencyInfo> getDependencies(final String moduleIdentifer);

	public IServiceManager[] getServiceManagers();

	public PlatformInfo getPlatformInfo();
}